﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YJKArchUtils.Utils.Generics
{
	public class XYZComparer : IEqualityComparer<XYZ>
	{
		public bool Equals(XYZ p, XYZ q)
		{
			return Geometry.IsEqual(p.DistanceTo(q), 0.0, 0.0001);
		}

		public int GetHashCode(XYZ p)
		{
			string text = p.X.ToString("#0.0000");
			string text2 = p.Y.ToString("#0.0000");
			string text3 = p.Z.ToString("#0.0000");
			return string.Concat(new string[]
			{
				"(",
				text,
				",",
				text2,
				",",
				text3,
				")"
			}).GetHashCode();
		}
	}
}
